package org.wukl.vhr.controller.emp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.wukl.vhr.model.ResponseBean;
import org.wukl.vhr.model.ResponsePageBean;
import org.wukl.vhr.service.EmployeeService;

@RestController
@RequestMapping("/emp/basic")
public class EmpBasicController {
    @Autowired
    private EmployeeService employeeService;
    @GetMapping("/employeePage")
    public ResponsePageBean getEmployeeByPage(@RequestParam(defaultValue = "1") Integer page,
                                              @RequestParam(defaultValue = "10") Integer size)
    {
        return employeeService.getEmployeeByPage(page,size);
    }
    @GetMapping("/")
    public ResponseBean getAllEmployee()
    {
        return ResponseBean.responseSuccess("数据加载成功",employeeService.getAllEmployee());
    }
}
